import os
os.mkdir("D:\\besti\\Desktop\\1924")
file = open('D:\\besti\\Desktop\\1924\\20192405.txt','w')
print("\n 创建完毕 \n")
file.write("20192405 张纹豪 python程序设计\n")
file.close()
file = open('D:\\besti\\Desktop\\1924\\20192405.txt','a')
file.write("20192417 张家华 python程序设计\n")
file.write("20192429 马一 python程序设计\n")
with open('D:\\besti\\Desktop\\1924\\20192405.txt','r') as file:
    number = 0
    while True:
        number += 1
        line = file.readline()
        if line == '':
            break
        print(number,line,end="\n")
print("改写成功~")
file.close()  